home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / dsiic2.zip / DIR-DEMO.C < prev    next >
C/C++ Source or Header  |  1991-07-15  |  701b  |  30 lines

  1. /* Copyright (c) James L. Pinson 1990,1991  */
  2.  
  3. /**********************   DIR-DEMO.C   ***************************/
  4.  
  5. #include "mydef.h"
  6. #include <stddef.h>
  7. #include <string.h>
  8.  
  9. int start(int argc, char *argv[])
  10. {
  11. extern struct screen_structure scr;
  12. extern struct window_structure w[];
  13.  
  14. int dir_win;        /* handle for directory window */
  15. char selection[13]; /* string to receive the name of file selected */
  16.  
  17. cls();
  18.  
  19. dir_win= win_make(35,2,12,20,STD_FRAME,"",scr.normal,scr.normal);
  20.  
  21. dir("*.*",selection);
  22. win_delete(dir_win);
  23.  
  24. if (strlen(selection)==0) print (1,1, "No file selected.");
  25.  else
  26.   print(1,1,"The selected file was "); print_here(selection);
  27.  
  28. return(0);
  29. }
  30.